<?php

namespace App\Providers;

use App\Events\Article\OperateEvent;
use App\Events\CallingCards\OfficialRecordEvent;
use App\Events\Cruise\CruiseCheckSelfTaskInsertOrUpdateEvent;
use App\Events\Cruise\CruiseOrder\CruiseOrderStatusChangeEvent;
use App\Events\Kms\DailyTaskCreateEvent;
use App\Events\Kms\GroupShareEvent;
use App\Events\Kms\PunchShareEvent;
use App\Events\Kms\TaskNodeFinishEvent;
use App\Events\OpenShop\AutoRefundDecorationDepositEvent;
use App\Events\OpenShop\CreatedQualificationCertificateEvent;
use App\Events\OpenShop\GenerateHeatMapImageEvent;
use App\Events\OpenShop\IntendedSiteSelection\InsertEvent;
use App\Events\OpenShop\OpenShopProcessEvent;
use App\Events\OpenShop\OrderClosedEvent;
use App\Events\OpenShop\OrderCreatedEvent;
use App\Events\OpenShop\JoinSucceededSmsSentEvent;
use App\Events\OpenShop\OrderEditedEvent;
use App\Events\OpenShop\OrderPaymentSucceededEvent;
use App\Events\OpenShop\OrderSignedEvent;
use App\Events\OpenShop\ShopCreatedEvent;
use App\Events\OpenShop\ShopCreatedOnceEvent;
use App\Events\OpenShop\SignSiteMissionEvent;
use App\Events\OpenShop\SignSmsSentEvent;
use App\Events\OpenShop\SystemNotifyCenterEvent;
use App\Events\OpenShop\UserContractCreatedEvent;
use App\Events\SiteLocation\WhiteListEvent;
use App\Events\WorkOrder\WorkOrderFinishEvent;
use App\Listeners\Activity\SyncActivityStatusListener;
use App\Listeners\Article\OperateListener;
use App\Listeners\CallingCards\CallingCardsOrderSignedListener;
use App\Listeners\CallingCards\ClueSaveAndPushListener;
use App\Listeners\Cruise\CruiseCheckSelfTaskInsertOrUpdateListener;
use App\Listeners\Cruise\CruiseDemoListener;
use App\Listeners\Cruise\CruiseOrder\CruiseOrderStatusChangeListener;
use App\Listeners\Kms\DailyTaskCreateListener;
use App\Listeners\Kms\GroupShareListener;
use App\Listeners\Kms\PunchShareListener;
use App\Listeners\Kms\TaskNodeFinishListener;
use App\Listeners\OpenShop\AutoRefundDecorationDepositListener;
use App\Listeners\OpenShop\CreatedQualificationCertificateListener;
use App\Listeners\OpenShop\CreateMerchantUser;
use App\Listeners\OpenShop\CreateShopManualListener;
use App\Listeners\OpenShop\GenerateHeatMapImageListener;
use App\Listeners\OpenShop\IntendedSiteSelection\InsertListener;
use App\Listeners\OpenShop\OrderContractCreatedLogListener;
use App\Listeners\OpenShop\ProcessNoticeListener;
use App\Listeners\OpenShop\ShopCreateContractListener;
use App\Listeners\OpenShop\CreateShopListener;
use App\Listeners\OpenShop\OpenShopProcessListener;
use App\Listeners\OpenShop\OrderAutoCloseListener;
use App\Listeners\OpenShop\OrderClosedLogListener;
use App\Listeners\OpenShop\OrderCreatedLogListener;
use App\Listeners\OpenShop\OrderEditedLogListener;
use App\Listeners\OpenShop\JoinSucceededSmsLogListener;
use App\Listeners\OpenShop\SendSmsInformByJoinListener;
use App\Listeners\OpenShop\SignSiteMissionListener;
use App\Listeners\OpenShop\SignSmsSentLogListener;
use App\Listeners\OpenShop\SystemNotifyAppListener;
use App\Listeners\OpenShop\SystemNotifyPushListener;
use App\Listeners\OpenShop\SystemNotifySmsListener;
use App\Listeners\SiteLocation\WhiteListListener;
use App\Listeners\WorkOrder\WorkOrderFinishListener;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use App\Events\Cruise\CruiseOrderChangeEvent;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array<class-string, array<int, class-string>>
     */
    protected $listen = [
        OfficialRecordEvent::class                  => [
            ClueSaveAndPushListener::class,
        ],
        // 订单创建
        OrderCreatedEvent::class                    => [
            CreateMerchantUser::class,
//            OrderCreatedLogListener::class,
        ],
        // 合同创建
        UserContractCreatedEvent::class             => [
            OrderAutoCloseListener::class,
            OrderContractCreatedLogListener::class,
        ],
        // 订单支付成功
        OrderPaymentSucceededEvent::class           => [
            CreateShopListener::class,
        ],
        // 店铺创建成功
        ShopCreatedEvent::class                     => [
            CreateShopManualListener::class,
        ],
        // 店铺创建成功 - 执行一次的任务
        ShopCreatedOnceEvent::class                 => [
            ShopCreateContractListener::class,
        ],
        // 订单签约短信已发送
        SignSmsSentEvent::class                     => [
            SignSmsSentLogListener::class,
        ],
        // 子流程变更日志监听
        OpenShopProcessEvent::class                 => [
            OpenShopProcessListener::class,
            ProcessNoticeListener::class,
        ],
        // 订单关闭(主动/超时自动)
        OrderClosedEvent::class                     => [
            OrderClosedLogListener::class,
        ],
        // 订单编辑
        OrderEditedEvent::class                     => [
            OrderEditedLogListener::class,
        ],

        // 订单合同完整签约事件
        OrderSignedEvent::class                     => [
            CallingCardsOrderSignedListener::class,
            SendSmsInformByJoinListener::class,
        ],
        // 加盟成功短信发送
        JoinSucceededSmsSentEvent::class            => [
            JoinSucceededSmsLogListener::class,
        ],
        // 生成资质证明
        CreatedQualificationCertificateEvent::class => [
            CreatedQualificationCertificateListener::class,
        ],
        // 任务生成事件
        SignSiteMissionEvent::class                 => [
            SignSiteMissionListener::class,
        ],
        // 消息中心通知-推送事件
        SystemNotifyCenterEvent::class              => [
            SystemNotifySmsListener::class,
            SystemNotifyAppListener::class,
            SystemNotifyPushListener::class,
        ],
        //开店自动退款单 - 装修保证金
        AutoRefundDecorationDepositEvent::class     => [
            AutoRefundDecorationDepositListener::class
        ],
        WorkOrderFinishEvent::class                 => [
            //工单完成
            WorkOrderFinishListener::class
        ],
        GenerateHeatMapImageEvent::class            => [
            //生成热力图
            GenerateHeatMapImageListener::class
        ],
        OperateEvent::class                         => [//文章 专题操作
            OperateListener::class
        ],
        GroupShareEvent::class                      => [//kms 资源分享到群组
            GroupShareListener::class
        ],
        PunchShareEvent::class                      => [//kms 打卡分享
            PunchShareListener::class
        ],
        DailyTaskCreateEvent::class                 => [//kms每日任务创建
            DailyTaskCreateListener::class
        ],
        TaskNodeFinishEvent::class                  => [//kms 任务节点完成监听事件
            TaskNodeFinishListener::class
        ],
        InsertEvent::class                          => [//开店意向址新增 监听事件
            InsertListener::class
        ],
        WhiteListEvent::class => [ //选址白名单变动
            WhiteListListener::class
        ],
        \App\Events\OpenShop\SignToPositionTimeEvent::class => [ //添加开店统计（统计落位时长）
            \App\Listeners\OpenShop\SignToPositionTimeListener::class
        ],
        CruiseOrderChangeEvent::class => [
//            CruiseDemoListener::class,
            SyncActivityStatusListener::class,
        ],
        CruiseOrderStatusChangeEvent::class => [// 门店自检表单状态变更事件监听
            CruiseOrderStatusChangeListener::class,
        ],
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}
